<?php

namespace application\model;

use application\entity\db\District;
use application\model\BaseModel;

class DistrictModel extends BaseModel {

    public function __construct() {
        parent::__construct(District::class);
    }

    /**
     * Tìm kiếm quận huyện theo mã thành phố
     * @param type $cityId
     * @return type
     */
    public function getByCityId($cityId) {
        $cri = new \core\entity\Criteria();
        $cri->andKey("cityId")->is($cityId);
        $query = new \core\entity\Query($cri);
        return $this->ifind($query);
    }

}
